﻿<template>
    <el-dialog :close-on-press-escape="false" :append-to-body="true" :visible="show" @opened="opened" @closed="closed" @close="show=false" :close-on-click-modal="false">
        <el-form ref="disTrade" label-position="right" label-width="120px" :model="disTrade" :rules="rules">
            <input type="hidden" :model="disTrade.id" />
            <el-form-item label="实际分销商总成本" prop="actualtotalpartnerproductcostmoney">
                <el-input v-model="disTrade.actualtotalpartnerproductcostmoney" placeholder="实际分销商总成本" style="width: 240px" />
            </el-form-item>
            <el-form-item label="实际分销商总售价" prop="actualtotalpartnerproductsalemoney">
                <el-input v-model="disTrade.actualtotalpartnerproductsalemoney" placeholder="实际分销商总售价" style="width: 240px" />
            </el-form-item>
            <el-form-item label="实际分销商总利润" prop="actualtotalpartnerprofitmoney">
                <el-input v-model="disTrade.actualtotalpartnerprofitmoney" placeholder="实际分销商总利润" style="width: 240px" />
            </el-form-item>
            <el-form-item label="实际付款" prop="actualtotalpaymoney">
                <el-input v-model="disTrade.actualtotalpaymoney" placeholder="实际付款" style="width: 240px" />
            </el-form-item>
            <el-form-item label="实际平台总成本" prop="actualtotalproductcostmoney">
                <el-input v-model="disTrade.actualtotalproductcostmoney" placeholder="实际平台总成本" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分类" prop="categories">
                <el-input v-model="disTrade.categories" placeholder="分类" style="width: 240px" />
            </el-form-item>
            <el-form-item label="创建时间" prop="createtime">
                <el-date-picker type="date" @change="cbtime" v-model="disTrade.createtime" placeholder="创建时间" style="width: 240px"></el-date-picker>
            </el-form-item>
            <el-form-item label="订单优惠" prop="discountmoney">
                <el-input v-model="disTrade.discountmoney" placeholder="订单优惠" style="width: 240px" />
            </el-form-item>
            <el-form-item label="处理人" prop="handler">
                <el-input v-model="disTrade.handler" placeholder="处理人" style="width: 240px" />
            </el-form-item>
            <el-form-item label="处理人" prop="handlerid">
                <el-input v-model="disTrade.handlerid" placeholder="处理人" style="width: 240px" />
            </el-form-item>
            <el-form-item label="处理时间" prop="handletime">
                <el-date-picker type="date" @change="cbtime" v-model="disTrade.handletime" placeholder="处理时间" style="width: 240px"></el-date-picker>
            </el-form-item>
            <el-form-item label="物流公司" prop="logisticscompany">
                <el-input v-model="disTrade.logisticscompany" placeholder="物流公司" style="width: 240px" />
            </el-form-item>
            <el-form-item label="物流公司" prop="logisticscompanyid">
                <el-input v-model="disTrade.logisticscompanyid" placeholder="物流公司" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商" prop="partner">
                <el-input v-model="disTrade.partner" placeholder="分销商" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商" prop="partnerid">
                <el-input v-model="disTrade.partnerid" placeholder="分销商" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商备注" prop="partnerremark">
                <el-input v-model="disTrade.partnerremark" placeholder="分销商备注" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商状态" prop="partnerstatus">
                <el-input v-model="disTrade.partnerstatus" placeholder="分销商状态" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品图片" prop="productimg">
                <el-input v-model="disTrade.productimg" placeholder="商品图片" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品" prop="products">
                <el-input v-model="disTrade.products" placeholder="商品" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku整箱尺寸" prop="productskuboxinfos">
                <el-input v-model="disTrade.productskuboxinfos" placeholder="sku整箱尺寸" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku编码" prop="productskucodes">
                <el-input v-model="disTrade.productskucodes" placeholder="sku编码" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku图片" prop="productskuimg">
                <el-input v-model="disTrade.productskuimg" placeholder="sku图片" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku件数" prop="productskuitemnums">
                <el-input v-model="disTrade.productskuitemnums" placeholder="sku件数" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku装箱信息" prop="productskupackageinfos">
                <el-input v-model="disTrade.productskupackageinfos" placeholder="sku装箱信息" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku货号" prop="productskupartnums">
                <el-input v-model="disTrade.productskupartnums" placeholder="sku货号" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku备注" prop="productskuremarks">
                <el-input v-model="disTrade.productskuremarks" placeholder="sku备注" style="width: 240px" />
            </el-form-item>
            <el-form-item label="sku重量" prop="productskuweights">
                <el-input v-model="disTrade.productskuweights" placeholder="sku重量" style="width: 240px" />
            </el-form-item>
            <el-form-item label="收货人地址" prop="reciveraddress">
                <el-input v-model="disTrade.reciveraddress" placeholder="收货人地址" style="width: 240px" />
            </el-form-item>
            <el-form-item label="收货人" prop="reciverid">
                <el-input v-model="disTrade.reciverid" placeholder="收货人" style="width: 240px" />
            </el-form-item>
            <el-form-item label="收货人" prop="recivername">
                <el-input v-model="disTrade.recivername" placeholder="收货人" style="width: 240px" />
            </el-form-item>
            <el-form-item label="收货人电话" prop="reciverphone">
                <el-input v-model="disTrade.reciverphone" placeholder="收货人电话" style="width: 240px" />
            </el-form-item>
            <el-form-item label="发货日期" prop="shippingtime">
                <el-date-picker type="date" @change="cbtime" v-model="disTrade.shippingtime" placeholder="发货日期" style="width: 240px"></el-date-picker>
            </el-form-item>
            <el-form-item label="系统备注" prop="sysremark">
                <el-input v-model="disTrade.sysremark" placeholder="系统备注" style="width: 240px" />
            </el-form-item>
            <el-form-item label="系统状态" prop="sysstatus">
                <el-input v-model="disTrade.sysstatus" placeholder="系统状态" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商总成本" prop="totalpartnerproductcostmoney">
                <el-input v-model="disTrade.totalpartnerproductcostmoney" placeholder="分销商总成本" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商总售价" prop="totalpartnerproductsalemoney">
                <el-input v-model="disTrade.totalpartnerproductsalemoney" placeholder="分销商总售价" style="width: 240px" />
            </el-form-item>
            <el-form-item label="分销商总利润" prop="totalpartnerprofitmoney">
                <el-input v-model="disTrade.totalpartnerprofitmoney" placeholder="分销商总利润" style="width: 240px" />
            </el-form-item>
            <el-form-item label="应付金额" prop="totalpaymoney">
                <el-input v-model="disTrade.totalpaymoney" placeholder="应付金额" style="width: 240px" />
            </el-form-item>
            <el-form-item label="平台总成本" prop="totalproductcostmoney">
                <el-input v-model="disTrade.totalproductcostmoney" placeholder="平台总成本" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品种数" prop="totalproductcount">
                <el-input v-model="disTrade.totalproductcount" placeholder="商品种数" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品优惠金额" prop="totalproductdiscountmoney">
                <el-input v-model="disTrade.totalproductdiscountmoney" placeholder="商品优惠金额" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品总价" prop="totalproductmoney">
                <el-input v-model="disTrade.totalproductmoney" placeholder="商品总价" style="width: 240px" />
            </el-form-item>
            <el-form-item label="商品总数量" prop="totalproductquantity">
                <el-input v-model="disTrade.totalproductquantity" placeholder="商品总数量" style="width: 240px" />
            </el-form-item>
            <el-form-item label="物流单号" prop="trackingnumber">
                <el-input v-model="disTrade.trackingnumber" placeholder="物流单号" style="width: 240px" />
            </el-form-item>
            <el-form-item label="单号" prop="tradeno">
                <el-input v-model="disTrade.tradeno" placeholder="单号" style="width: 240px" />
            </el-form-item>
        </el-form>
        <div slot="footer">
            <el-button @click="cancel">取消</el-button>
            <el-button type="primary" :loading="modalLoading" @click="ok">确定</el-button>
        </div>
    </el-dialog>
</template>
<script>
export default {
    name: 'DisTrade',
    data() {
        return {

            show: false,
            modalLoading: false,
            disTradeId: "",
            disTrade: {

            },
            rules: {

            }
        };
    },
    mounted: function() {


    },
    methods: {
        cbtime: function(value) {
            this.others;
        },
        opened() {

            this.getDetail();

        },
        closed() {
            this.disTrade = {

            }
        },
        showDialog(id) {
            this.disTradeId = id;
            this.show = true;
        },
        getDetail: function() {
            if (this.disTradeId == null || this.disTradeId == undefined || this.disTradeId == "") return;
            var me = this;
            me.showLoading();
            me.$http.post("/sys/distrade/show_" + me.disTradeId + ".do").then(response => {
                var body = response;
                if (body.status == 0) {
                    me.disTrade = body.obj;

                }
                me.hideLoading();
            }, response => {
                me.hideLoading();
            });
        },
        ok: function() {
            var ok = false;
            this.$refs['disTrade'].validate((valid) => {
                ok = valid;
                if (valid) {

                } else {
                    this.errorMessage('请认真填写数据');
                }
            })
            if (!ok) return;
            var me = this;

            me.modalLoading = true;
            me.$http.post("/sys/distrade/doSave.action", me.disTrade).then(response => {
                var body = response;
                if (body.status == 0) {
                    me.successMessage("保存成功！");
                    me.show = false;
                    me.$emit("ok");

                } else {
                    me.errorMessage(body.info);
                }
                me.modalLoading = false;
            }, response => {
                me.modalLoading = false;
            });
        },
        cancel: function() {
            this.disTrade = {};
            this.show = false;
            this.$emit("cancel");
        }
    }
}
</script>
<style scoped>
</style>